<?php

namespace Admin\Controller;



class SubscribeController extends AdminController {

	public function index(){

		$obj = M('Subscribe');

		$count = $obj->where($map)->count();

		import("Common.ORG.Page");

		$page = new \Page($count, 20);

		$show = $page->show();

		$list = $obj->where($map)->order('id desc')->limit($page->firstRow . ',' . $page->listRows)->select();

		$this->assign('list', $list);

		$this->assign('page', $show);

		$this->display();

	}


	public function del(){	

		$id=I('post.selectedids');



		if($id==''){

			$state = "You do not select any information!";

		}else{

			foreach ($id as $v) {

				$obj = M('Subscribe');

				$where['id'] = $v;

				$obj->where($where)->delete();

			}

			$state = 'SUCCESS';

	        $message = 'Successful operation';

	        $url = U('Subscribe/index');

		}

		echo $this->echo_json_str($state,$message,$url);

    }

}

?>